package com.junxonline.instant.dao.entity.model.config;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.ToStringSerializer;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.junxonline.instant.common.entity.common.CommonEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 系统角色表实体类
 *
 * @author JunX
 * @date 2021-07-04
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "sys_role")
public class Role extends CommonEntity {

    /**
     * ID
     */
    @TableId(type = IdType.AUTO)
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Long id;

    /**
     * 角色名称
     */
    @TableField(value = "name")
    private String name;

    /**
     * 备注
     */
    @TableField(value = "remarks")
    private String remarks;

    /**
     * 状态
     */
    @TableField(value = "status")
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Integer status;

    /**
     * 数据权限
     */
    @TableField(value = "data_scope")
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Integer dataScope;

    /**
     * 组织机构ID
     */
    @TableField(value = "organization_id")
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Long organizationId;

    /**
     * 所属机构
     */
    @TableField(exist = false)
    private String organizationName;

}
